<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>可调货商品</title>
<style type="text/css">
	.stdtable tbody tr td{padding:3px 5px;}
</style>
</head>

<body>
<div class="centercontent tables">
    <div class="pageheader notab">
        <h1 class="pagetitle">可调货商品</h1>
        <div class="menulist">
            <ul class="profile_summary">
                <li><a href="javascript:;" onclick="showChangeStockForm()"><span>调货其它商品</span></a></li>
           </ul>
        </div>
        <span class="pagedesc"></span>
    </div>
</div>
<div class="contentwrapper">
<form class="stdform stdform2" method="post" action="/sales/ajaxbutton?op=confirmNeed">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                <thead>
                <tr>
                  <th class="head1">&nbsp;</th>
                    <th class="head1">商品编号</th>
                    <th class="head1">名称</th>
                    <th class="head1">未来3天预计销量</th>
                    <th class="head1">待发货</th>
                    <th class="head1">一号仓库存</th>
                  <th class="head1">二号仓库存</th>
                  <th class="head1">需调拔数</th>
                </tr>
                </thead>
                <tbody>
                {{foreach from=$datalist item=li key=key}}
                <tr>
                  <td><input name="storeid[]" type="checkbox" value="{{$li.id}}"></td>
                    <td><a href="/product/productlist?other={{$li.goods_sku}}&filtertype=skuc" target="_blank">{{$li.goods_sku}}</a>
                  <input type='hidden' name='good_sku[{{$li.id}}]' value="{{$li.goods_sku}}"></td>
                  <td>{{$li.goods_name}}<input type='hidden' name='goods_name[{{$li.id}}]' value="{{$li.goods_name}}"></td>
                    <td>{{$li.day_salys}}</td>
                    <td>{{$li.sendgoodsnum}}</td>
                    <td>{{$li.stock}}                  </td>
                  <td>{{$li.two_stock}}
                    <input type='hidden' name='two_stock[{{$li.id}}]' value="{{$li.two_stock}}">
                    <input type='hidden' name='two_stockid[{{$li.id}}]' value="{{$li.two_stockid}}">                  </td>
                  <td><input name="need_store[{{$li.id}}]" type="text" style="width:30px;padding:4px 4px;" value="{{$li.needstore}}" /></td>
                </tr>
                {{/foreach}}    
                <tr>
                  <td><input name="allchk" id="allchk" type="checkbox" onClick="allSelect('storeid[]')"></td>
                  <td colspan="7" align="center"><button id="btn" type="submit" class="submit radius2">生成调货单</button></td>
                </tr>     
                </tbody>
            </table>
  </form>
            <div class="page">{{$pageList}} 计{{$total}}条记录</div>
</div>

<form action="/sales/ajaxbutton?op=checkNeedStock"  method="post" name="batchendorderST" id="batchendorderST">
  <div class="modal fade" id="endorderform" tabindex="-1" role="dialog" aria-labelledby="sendorderform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sendorderform"> 二号仓调货到一号仓</h4>
        </div>
        <div class="modal-body">
         <span id="errshow"></span>
<table class="stdtable st1" cellspacing="0" cellpadding="0" border="1" width="550" align="center">
 <thead>
  <tr class="child_subject tit">
    <th width="282" align="right" class="head1" style="text-align:right;">商品SKU编号</th>
    <th width="262" class="head1"><strong>调拨数量</strong></th>
  </tr>
 </thead>
   <tr>
    <td align="right"><input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td>
    <td>    <input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text">    </td>
  </tr>
    <tr>
    <td align="right"><input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td>
    <td>    <input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text">    </td>
  </tr>
    <tr>
    <td align="right"><input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td>
    <td>    <input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text">    </td>
  </tr>
    <tr>
    <td align="right">
      <input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td>
    <td>    <input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text">    </td>
  </tr>
    <tr>
    <td align="right">
      <input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td>
    <td>    <input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text"> </td>
  </tr>
<tbody id="fileinput">
            </tbody></table>
          <div class="modal-footer" style="text-align:center">
            
            &nbsp;<button id="btn" type="submit" class="submit radius2">下一步</button>
            <button type="button" style="position:absolute;right:30px;" onclick="showaddgoodsSKU('fileinput')" id="addlinebtn" class="submit radius2 addlinebtn">增加一行</button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  </form>
<script language="javascript">
	function showChangeStockForm(){
		$('#endorderform').modal('show');
	}

	/********增加多行商品*******************/
	var totalnum = 1;
	function showaddgoodsSKU(t) {
		var inputn = document.getElementById(t);
		var str = inputn.innerHTML;
		var num = 1;
		for (var i = 1; i <= num; i++) {
			totalnum = totalnum + i;
			str += "<tr id=las" + totalnum + ">";
			str += '<td align="right"><input name="goods_sku[]" style="width:130px;padding:4px 4px;" type="text" /></td><td><input name="need_stock[]" style="width:30px;padding:4px 4px;" type="text"></td>';
			str += "</tr>";
		}
		$("#" + t).html(str);
	
	}
</script>
</body>
</html>
